//package cn.fuxi2022.core.config;
//
//import io.swagger.annotations.Api;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import springfox.documentation.builders.ApiInfoBuilder;
//import springfox.documentation.builders.PathSelectors;
//import springfox.documentation.builders.RequestHandlerSelectors;
//import springfox.documentation.service.ApiInfo;
//import springfox.documentation.service.Contact;
//import springfox.documentation.spi.DocumentationType;
//import springfox.documentation.spring.web.plugins.Docket;
//import springfox.documentation.swagger2.annotations.EnableSwagger2;
//
//@Configuration
//@EnableSwagger2
//@ConditionalOnClass(Docket.class)
//public class Swagger2Config {
//
//    private static final String VERSION = "1.0";
//
//    @Value("${spring.swagger2.enabled}")
//    private Boolean swaggerEnabled;
//
//    @Bean
//    public Docket webApiConfig() {
//        return new Docket(DocumentationType.SWAGGER_2)
//                // 读取配置文件，判断是否需要打开
//                .enable(swaggerEnabled)
//                .groupName("SmartGroup")
//                .apiInfo(webApiInfo())
//                .select()
//                // 给加上@API注解的类自动生成接口文档
//                .apis(RequestHandlerSelectors.withClassAnnotation(Api.class))
//                //只显示api路径下的页面
//                //.paths(Predicates.and(PathSelectors.regex("/api/.*")))
//                // 显示所有路径
//                .paths(PathSelectors.any())
//                .build();
//    }
//
//    private ApiInfo webApiInfo() {
//        return new ApiInfoBuilder()
//                .title("API接口文档")
//                .description("本文档描述了网站微服务接口定义")
//                .version(VERSION)
//                // 人员消息
//                .contact(new Contact("福熙", "https://fuxi.cn", "fuxi_2022@163.com"))
//                .build();
//    }
//}